(function () {
    var bannerNav = document.getElementById('banner-nav');
    var bannerLi = document.querySelectorAll('.banner-nav .menu-list li');
    var menuLi = document.querySelectorAll('.banner-nav .menus-list ul');

    bannerNav.onmouseover = function (e) {
        // 看看是否触碰到li
        if (e.target.tagName.toLowerCase() == 'li') {

            // 获取data-n的值
            var dataN = e.target.getAttribute('data-t');
            var a='.menus-list .menu[data-t=' + dataN + ']'
            console.log(a)
            var themenu = document.querySelector('.menus-list .menu[data-t=' + dataN + ']');
            console.log(themenu)
            // 先做一下右边list的排他
            for (i = 0; i < menuLi.length; i++) {
                // console.log(bannerLi[i]);
                menuLi[i].className = "menu";
            themenu.className='menu current';
            }
        }
    }

    bannerNav.onmouseleave=function(){
        for(i=0;i<menuLi.length;i++){
            menuLi[i].className = 'menu';
        }

    }


})();